
#pragma once

#include "type.h"

struct TalentItem {
	string key;
	string title;
	string text;

	int currentLevel;
	int maxLevel;
	int normalModeLimitLevel;

	float x;
	float y;

	vector<float> arrValue1;
	vector<float> arrValue2;
	vector<float> arrValue3;
	vector<float> arrValue4;
	vector<float> arrValue5;
	vector<string> arrUpgradeCost;

	vector<pair<string, int> > parents;

	TalentItem() {
		key = "";
		text = "";

		currentLevel = maxLevel = normalModeLimitLevel = 0;

		x = y = 0;
	}


	bool isParent(const string& k) {
		for(size_t i = 0; i < parents.size(); i++) {
			pair<string, int> item = parents[i];
			if(item.first == k) {
				return true;
			}
		}

		return false;
	}

	float getUpgradeCost(int levelIndex) {
		CCAssert(arrUpgradeCost.size() > 0, "talent item may not initialized properly.");
			return atof(arrUpgradeCost[levelIndex].c_str());
	}
};
